package com.hongye.agent.controller;

import com.hongye.agent.entity.HongyeHouse;
import com.hongye.agent.service.SecondHandHouseService;
import com.hongye.agent.vo.FindSecondHandHouseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author caojianbin
 * @time 2022/4/29
 */
@RestController
@RequestMapping("/agent/secondhandhouse")
public class SecondHandHouseController {

    @Autowired
    private SecondHandHouseService secondHandHouseService;

    /**
     * @param findSecondHandHouseVo
     * orderById 根据价钱倒序正序
     * @return
     * 首页-二手房列表
     */
    @RequestMapping("/findSecondHandHouse")
    public List<HongyeHouse> findSecondHandHouse(@RequestBody FindSecondHandHouseVo findSecondHandHouseVo){
        return secondHandHouseService.findSecondHandHouse(findSecondHandHouseVo);
    }
}
